$(function(){
    var fn = ABUS.Fn;
    var area = $("textarea");
    area.on("input", function () {
        var len = $(this).val().length;
        if(len >= 200){
            return false;
        }
        $('.font_length').text(len + '/200');
    });
    area.val($.trim(__param__.problemRemark));
    area.trigger("input");

    $(".rightBtn").on("touchend",function () {

        fn.confirm({
            onSubmit: function () {
                fn.get({
                    url:"/common/order/setProblemOrder",
                    data:{
                        orderId:__param__.orderId,
                        childOrderId:__param__.childOrderId,
                        problemRemark:$("textarea").val()
                    },
                    success:function (data) {
                        if(data.result == 1){
                            window.history.back();
                        }else{
                            alert(data.message)
                        }
                    }
                })
                fn.closeModal();
            },
            onCancel: function () {
                fn.closeModal();
            }
        });

    });
});
